package com.example.hutool.util.demo.csv;

import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.text.csv.CsvUtil;

import java.io.Reader;
import java.util.List;

/**
 * @author 李克国
 * @date 2021/8/17
 */
public class Main {
    public static void main(String[] args) {
//        Reader reader = ResourceUtil.getUtf8Reader("classpath:window-file.csv");
//        Reader reader = ResourceUtil.getUtf8Reader("classpath:mac-file.csv");

        Reader reader = ResourceUtil.getUtf8Reader("classpath:mac-test.csv");
        List<TestBean> list = CsvUtil.getReader().read(reader, TestBean.class);

        for (TestBean testBean : list) {
            System.out.println(testBean);
        }
    }
}
